package demo001;

import java.util.ArrayList;
import java.util.HashMap;

import org.freedesktop.dbus.DBusAsyncReply;
import org.freedesktop.dbus.connections.impl.DBusConnection;
import org.freedesktop.dbus.exceptions.DBusException;
import org.freedesktop.dbus.interfaces.*;
import org.freedesktop.dbus.messages.MessageFactory;
import org.freedesktop.dbus.messages.MethodCall;
import org.freedesktop.dbus.types.UInt32;

public class Test {
	public static void main(String[] args) {
		DBusConnection conn = null;
		try {
			conn = DBusConnection.getConnection(DBusConnection.DBusBusType.SYSTEM);
		} catch (DBusException De) {
			System.out.println("11111");
			System.exit(1);
		}

		DBusInterface m_interface = null;
		try {
			m_interface = conn.getRemoteObject("org.freedesktop.Notifications", "/org/freedesktop/Notifications");
		} catch (DBusException De) {
			System.out.println("22222");
			System.exit(1);
		}

		String appName = "appname";
		Object replaceId = 0;
		String appicon = "";
		String summy = "summy";
		String body = "body";
		ArrayList<String> actions = null;
		HashMap<String, String> hints = null ;
		int timeout = 0;
		conn.callMethodAsync(m_interface,"Notify",
			appName,
			replaceId,
			appicon,
			summy,
			body,
			actions,
			hints,
			timeout);

	}
}
